<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>teste</title>
</h:head>

<h:body>
	
	<p:growl id="growl" autoUpdate="true"/>
	
		<p:panelGrid id="panel" columns="1">
		<h:form id="formulario">

			<p:commandButton value="Submeter" action="#{immediateTestBean.atualizarModel}" update="table" immediate="true"/>
	
			<p:dataTable id="table" value="#{immediateTestBean.list}" var="row"
				rowKey="#{row[0]}" 
				selectionMode="multiple" selection="#{immediateTestBean.selections}" >
				
				<p:ajax event="rowSelect" immediate="true"/>  
				<p:ajax event="rowUnselect" immediate="true"/>  
				
				<p:column headerText="Estatica">
					<h:outputLabel value="Linha " />
				</p:column>
				
				<p:column headerText="Coluna 1">
					<p:inplace editor="true" >
						<p:inputText value="#{row[0]}" required="true" requiredMessage="Campo 1 obrigatorio..."/>
					</p:inplace>
				</p:column>
			
				<p:column headerText="Coluna 2">
					<p:inplace editor="true">
						<p:inputText value="#{row[1]}" required="false" requiredMessage="Campo 2 obrigatorio..."/>
					</p:inplace>	
				</p:column>
			
				<p:column headerText="Coluna 3">
					<p:inplace editor="true">
						<p:inputText value="#{row[2]}" required="false" requiredMessage="Campo 3 obrigatorio..."/>
					</p:inplace>
				</p:column>
			
			</p:dataTable>		
			
			</h:form>
		</p:panelGrid>

</h:body>
   
</html>